﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Aribaccio.Copyright
{
    /// <summary>
    /// 注册版权期限消息
    /// </summary>
    [ComVisible(true)]
    [ClassInterface(ClassInterfaceType.None)]
    public class RegisterCopyMsg : IRegisterCopyMsg
    {
        /// <summary>
        /// 状态
        /// </summary>
        public RegisterCopyStatus Status { get; set; }
        /// <summary>
        /// 状态消息
        /// </summary>
        public string StatusMsg { get; set; }
        /// <summary>
        /// 期限剩余天数
        /// </summary>
        public int LimitSurplusDays { get; set; }
        /// <summary>
        /// 期限剩余天数显示信息
        /// </summary>
        public string LimitSurplusDaysDisplay
        {
            get
            {
                switch (Status)
                {
                    case RegisterCopyStatus.OK:
                    case RegisterCopyStatus.OKRegister:
                        return $"有效天数：{this.LimitSurplusDays}";
                    case RegisterCopyStatus.OKTimeLimits:
                    case RegisterCopyStatus.None:
                    default: return $"试用天数：{this.LimitSurplusDays}";
                }
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public RegisterCopyMsg()
        {
            this.Status = RegisterCopyStatus.None;
            this.StatusMsg = string.Empty;
        }
    }
}
